import java.util.Arrays;
public class t1 {
    public static void main(String []args){
        Sum p = new Sum();
        int[] numes =new int []{3,2,4};
        p.sum(numes ,6);
    }
}

class Sum {

    public static void sum(int[] numes, int target){
        int arr[] = new int[2];
        for (int i = 0; i <= numes.length - 1; i++) {
            arr[0] = 0 ; arr[1] = 0;
            for (int j = i + 1; j <= numes.length - 1; j++){
                if (numes[i] + numes[j] == target) {
                    arr[0] = i;
                    arr[1] = j;
                }
            }

            if(arr[0]!=0 && arr[1]!=0){
                break;
            }
        }

        System.out.println(Arrays.toString(arr));
    }

}








